﻿@using CuongHanh.Context
@using CuongHanh.Models
@{
    List<TiGia> tigia = CacheStringKey<TiGia>.Singleton.GetObjectsByFilter().ToList();
}

<style type="text/css">
    .table-tigia {
        border: 1px #002659 solid;
        margin-top: 5px;
        text-align: center;
        width: 100%;
    }

    .table-tigia th {
        background-color: #0088CB;
        color: white;
        font-weight: bold;
        height: 25px;
        padding-top: 5px;
    }

    .table-tigia td {
        height: 25px;
        padding-top: 5px;
    }

    .tigia-link { color: blue; }
</style>
<div style="padding-top: 10px;">
    <div style="text-align: left;">
        <a class="tigia-link" target="_blank" href="https://www.vietcombank.com.vn/ExchangeRates/">Update from Vietcombank </a><span style="color: green;">@TiGiaContext.Singleton.LastUpdate</span> </div>
    <table class="table-tigia" >
        <tr>
            <th >Code</th>
            <th>Name</th>
            <th>Exchange (VND)</th>
        </tr>
        <tbody>
            @foreach (TiGia item in tigia)
            {
                <tr>
                    <td>@item.Code</td>
                    <td >@item.Name</td>
                    <td> @item.Buy.FormatNumber()</td>
                </tr>
            }
          
        </tbody>
    </table>
</div>